package newcoder.huawei.lx_HJ2_计算某字母出现次数;

import java.util.Scanner;

/**
 * @author Mr.wang
 * @date 2021/11/11
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String nextLine = scanner.nextLine();
        String nextLine1 = scanner.nextLine();
        String replaceAll = nextLine.toLowerCase().replaceAll(nextLine1.toLowerCase(), "");
        System.out.println(nextLine.length() - replaceAll.length());
    }
}
